<template>
  <div>
    <header-nav :user='userObj' />
    <img class='bgimg' src="@/assets/img/bannerTop_new.png" />
    <user-box :user='userObj' />
  </div>
</template>
<script>
import { getProfile } from '@/api/user.js'
import HeaderNav from '@/components/header-nav/'
import UserBox from '@/components/user-box/'
export default {
  components: {
    HeaderNav,
    UserBox
  },
  data() {
    return {
      userObj: {}
    }
  },
  created() {
    this.loadProfile()
  },
  methods: {
    async loadProfile() {
      const { data: res } = await getProfile(this.$store.state.user.id)
      this.userObj = res[0]
    }
  }
}
</script>
<style lang="less" scoped>
.bgimg {
  width: 100%;
  height: 110px;
}
</style>
